// -----------------------
// General
// -----------------------
.photoviewer-modal {
  position: absolute;
  z-index: 1090;
  width: 320px;
  height: 320px;
  cursor: default;
  overflow: visible !important;
}

.photoviewer-inner {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background-color: rgba(255, 255, 255, .85);
  box-shadow: 0 2px 10px 2px rgba(0, 0, 0, .3);
  border-radius: 5px;
  border: 1px solid #666;
  backdrop-filter: blur(5px);
  cursor: inherit;
  overflow: hidden;
}

.photoviewer-maximize {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  .photoviewer-inner {
    border-radius: 0;
  }

  .photoviewer-resizable-handle {
    display: none;
  }
}

.photoviewer-toolbar {
  font-size: 0;
}

.photoviewer-button {
  display: inline-block;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  margin: 0;
  font-size: 16px;
  color: #3d3d3d;
  line-height: 1;
  text-align: center;
  background: none;
  border-width: 0;
  border-radius: 0;
  cursor: pointer;
  outline: none;

  &:hover {
    color: #111;
  }

  svg {
    display: inline-block;
    font-size: inherit;
    width: 1em;
    height: 1em;
    overflow: visible;
    vertical-align: -.125em;
  }
}

.photoviewer-header {
  position: relative;
  z-index: 2;
  height: 30px;

  .photoviewer-toolbar {
    float: right;
  }

  .photoviewer-button {
    height: 30px;

    &:hover {
      color: #333;
      background-color: #eee;
    }
  }

  .photoviewer-button-close {
    &:hover {
      color: #fff;
      background-color: #ff4545;
    }
  }
}

.photoviewer-title {
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  user-select: none;
  color: #333;
  overflow: hidden;
}

.photoviewer-stage {
  position: absolute;
  top: 30px;
  right: 0;
  bottom: 40px;
  left: 0;
  z-index: 1;
  border-top: 1px solid #666;
  border-bottom: 1px solid #666;
  background-color: #fff;
  overflow: hidden;

  &.stage-ready {
    text-align: center;
    font-size: 0;

    &:before {
      content: '';
      display: inline-block;
      height: 100%;
      vertical-align: middle;
      overflow: hidden;
    }
  }
}

.photoviewer-image {
  position: relative;
  display: inline-block;

  &.image-ready {
    max-width: 100%;
    max-height: 100%;
    vertical-align: middle;
  }
}

.photoviewer-footer {
  position: absolute;
  bottom: 0;
  z-index: 2;
  width: 100%;
  height: 40px;
  color: #fff;
  text-align: center;

  .photoviewer-toolbar {
    display: inline-block;
  }
}

// loader
.photoviewer-loader {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  bottom: 40px;
  z-index: 2;
  text-align: center;
  color: #333;

  &::before {
    content: '';
    display: inline-block;
    position: relative;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, .5) rgba(0, 0, 0, .5) rgba(0, 0, 0, .5) rgba(255, 255, 255, .5);
    border-radius: 100%;
    vertical-align: middle;
    animation: photoviewerLoading 1s infinite linear;
  }

  &::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 100%;
    vertical-align: middle;
    overflow: hidden;
  }
}

@keyframes photoviewerLoading {
  0% {
    transform: rotateZ(0deg) translate3d(0, 0, 0);
  }

  100% {
    transform: rotateZ(360deg) translate3d(0, 0, 0);
  }
}
